{extend name="common/main"/}

{block name="body"}
<div class="main-title">
    <h2>浏览记录</h2>
</div>



<div class="button-box row clearfix">

    <div class="col-md-8">
        <button class="btn btn-success ajax-post" url="{:url('status', ['status'=> 1])}" target-form="ids">
            启用
        </button>
        <button class="btn btn-warning ajax-post" url="{:url('status', ['status'=> 0])}" target-form="ids">
            禁用
        </button>
        <button class="btn btn-danger ajax-post confirm" url="{:url('status', ['status'=> -1])}" target-form="ids">
            删除
        </button>
    </div>

    <!-- 高级搜索 -->
    <div class="search-form col-md-4">
        <form action="" method="get" class="search-form" role="form">
            <div class="col-sm-4">
                <select name="app" class="form-control">
                    <option value="all">全部应用</option>
                    {volist name="all_module" id="row"}
                    {if $app == $row['name']}
                    <option selected value="{$row['name']}">{$row['alias']}</option>
                    {else}
                    <option value="{$row['name']}">{$row['alias']}</option>
                    {/if}
                    {/volist}
                </select>
            </div>
            <div class="col-sm-8">
                <div class="input-group">
                    <div class="input-control search-box has-icon-left has-icon-right search-example" id="searchbox">
                        <input class="form-control" name="uid" placeholder="用户ID" id="" type="text" value="{$uid}">
                        <label for="searchbox" class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label>
                    </div>
                    <span class="input-group-btn">
                    <button class="btn btn-primary" type="submit">搜索</button>
                    </span>
                </div>
            </div>
        </form>
    </div>
</div>

<div class="data-table with-padding">
    <section class="see-list-section clearfix">
        {notempty name="lists"}
        <table class="table table-bordered table-striped table-hover muu-table " id="table-data">
            <thead>
            <tr>
                <th width="40">
                    <input class="check-all" id="check-all" type="checkbox">
                    <label for="check-all"></label>
                </th>
                <th>ID</th>
                <th>产品</th>
                <th>用户</th>
                <th>应用</th>
                <th>收藏时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            {foreach $lists as $k=>$v}
            <tr>
                <td>
                    <input class="ids" id="see_{$v['id']}" name="ids[]" type="checkbox" value="{$v['id']}">
                    <label for="see_{$v['id']}"></label>
                </td>
                <td>{$v['id']}</td>
                <td class="products" style="width: 600px">
                    <div class="cover">
                        <img src="{$v['products']['cover_100']}">
                    </div>
                    <div class="info">
                        <div class="title text-ellipsis">{$v['products']['title']|default=''}</div>
                        {if isset($v['products']['desc'])}
                        <div class="description text-ellipsis-2">{$v['products']['desc']|default=''}</div>
                        {/if}
                    </div>
                </td>
                <td style="width: 300px">
                    {if !empty($v.uid) && !empty($v.user_info) && $v.user_info != -1}
                    <a class="user-info" href="{:url('admin/Member/detail',['uid'=>$v['uid']])}">
                        <div class="avatar">
                            <img src="{$v['user_info']['avatar64']}">
                        </div>
                        <div class="info">
                            <div class="nickname text-ellipsis">[{$v.uid|default=0}]{$v.user_info.nickname|default=""}</div>
                        </div>
                    </a>
                    {else}
                    用户已删除
                    {/if}
                </td>
                <td>{$v['module_name']}</td>
                <td>{$v['create_time_str']}</td>
                <td style="width: 150px">
                    <a href="{:url('status',['ids'=>$v['id'], 'status'=> -1])}" data-confirm="确认执行删除操作？" class="btn btn-sm btn-danger ajax-get"><i class="fa fa-times"></i> 删除</a>
                </td>
            </tr>
            {/foreach}
            </tbody>
        </table>
        {else/}
        {include file="common/_empty"/}
        {/notempty}
    </section>
    <div class="page-section">
        {:htmlspecialchars_decode($pager)}
    </div>
</div>
{/block}

{block name="script"}

{/block}